package com.smzd.core.domain;

public class BaseOwnedEntity<O extends IntIdEntity> extends BaseIntIdEntity
		implements IOwnedEntity<O> {
	private static final long serialVersionUID = -7486357137811012154L;

	protected O owner;
	
	

	public BaseOwnedEntity() {
		super();
	}

	public BaseOwnedEntity(Integer id, String name) {
		super(id, name);
	}

	public BaseOwnedEntity(Integer id) {
		super(id);
	}

	@Override
	public void setOwner(O owner) {
		this.owner = owner;
	}

	@Override
	public O getOwner() {
		return owner;
	}

	@Override
	protected void extStrings(StringBuffer sb) {
		super.extStrings(sb);
		sb.append(", owner: ").append(owner == null ? null : owner.getId());
	}

}
